﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="indexmap.aspx.cs" Inherits="lcs.Web.Admin.TimeLine.indexmap" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script src="js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=1.5&ak=6a5e0746feee514e8bb7b3f468a626d1">
    </script>
    <script type="text/javascript" src="http://api.map.baidu.com/library/TextIconOverlay/1.2/src/TextIconOverlay_min.js"></script>
    <%--<script type="text/javascript" src="http://api.map.baidu.com/library/MarkerClusterer/1.2/src/MarkerClusterer_min.js"></script>--%>
    <style type="text/css">
        html, body {
    height: 100%;
    width: 100%;
}
        #mymap {
            width: 100%;
            height: 100%;
            overflow: hidden;
            margin: 0;
            font-family: "微软雅黑";
        }
    </style>
<script type="text/javascript">
    var ptc=<%# lng %>;
    var pth=<%# lat %>;
    var pn;
    var map;
    var pid = "";
    var pcid = "";
    var mid = "";
    var timeid;    
    var home = new BMap.Icon('images/house.png', new BMap.Size(16, 16), { anchor: new BMap.Size(8, 16) });
    var issopt = "";
    $(function () {        
        InitMap();
    });
    function InitMap() {
        map = new BMap.Map("mymap");          // 创建地图实例 
        map.addControl(new BMap.MapTypeControl());   //添加地图类型控件            
        //map.centerAndZoom("济南", 11);
        map.enableScrollWheelZoom(true);
        var top_left_control = new BMap.ScaleControl({ anchor: BMAP_ANCHOR_TOP_LEFT });// 左上角，添加比例尺
        var top_left_navigation = new BMap.NavigationControl();  //左上角，添加默认缩放平移控件
        map.addControl(top_left_control);
        map.addControl(top_left_navigation);
        map.clearOverlays();
        var pt = new BMap.Point(ptc, pth);        
        marker = new BMap.Marker(pt, { icon: home });
        var label = new BMap.Label("<%# lblname %>", { offset: new BMap.Size(20, -10) });
        marker.setLabel(label);
        map.addOverlay(marker);        
        addClickHandler("", marker);        
        map.centerAndZoom(pt, 15);
        
    }    
    function addClickHandler(did, marker) {
        marker.addEventListener("click", function (e) {
            showawsinfectInfo(did);
        }
        );
    }
   
    function showawsinfectInfo(id) {
        top.addTab(pid + "_" + pcid + "_" + mid, '/gpsinfo/listmaterial.aspx?pid=' + pid + '&pcid=' + pcid + '&mid=' + mid);
    }
    
    </script>
</head>
<body>
   
    <div style="position: relative; width: 98%; height: 98%;">
                <div id="mymap"></div>                
            </div>
    
</body>
</html>
